
const db = require('./db')
const Hotel = require('../../classes/Hotel')
const Rate = require('../../classes/Rate')

class App {
  constructor () {
    this.hotels = db.map(hotel => {
      return new Hotel(hotel.name, hotel.rating, new Rate(hotel.rate))
    })
  }

  getHotels () {
    return this.hotels
  }
}

module.exports = App
